var express = require('express');
var router = express.Router();
var Route = require('../models/route')

/* GET home page. */
// router.get('/base/index', function(req, res, next) {
//   res.render('base/index', Route.sift('base' , 'index'));
// });
router.get('/', function(req, res, next) {
    res.redirect('/login');
});
router.get('/login', function(req, res, next) {
    res.render('common/login', {});
});
router.get('/base/authority', function(req, res, next) {
    res.render('base/authority', Route.sift('base' , 'authority'));
});
router.get('/base/area', function(req, res, next) {
    res.render('base/area', Route.sift('base' , 'area'));
});
router.get('/base/msg', function(req, res, next) {
    res.render('base/msg', Route.sift('base' , 'msg'));
});
router.get('/base/msg_add', function(req, res, next) {
    res.render('base/msg_add', Route.sift('base' , 'msg'));
});
router.get('/base/msg_detail', function(req, res, next) {
    res.render('base/msg_details', Route.sift('base' , 'msg'));
});
router.get('/business/index', function(req, res, next) {
    res.render('business/index', { type: 1 });
});
router.get('/user/index', function(req, res, next) {
    res.render('user/index', { type: 2 });
});

//产品管理
router.get('/base/variety', function(req, res, next) {
    res.render('base/variety', Route.sift('base' , 'variety'));
});
router.get('/base/classification', function(req, res, next) {
    res.render('base/classification', Route.sift('base' , 'classification'));
});
router.get('/base/region', function(req, res, next) {
    res.render('base/region', Route.sift('base' , 'region'));
});
router.get('/base/brand', function(req, res, next) {
    res.render('base/brand', Route.sift('base' , 'brand'));
});

module.exports = router;
